widgetpaintable: Use new snapshot transforms
authorBenjamin Otte <otte@redhat.com>
Thu, 21 Feb 2019 04:34:12 +0000 (05:34 +0100)
committerBenjamin Otte <otte@redhat.com>
Thu, 21 Feb 2019 18:47:28 +0000 (19:47 +0100)
gtk/gtkwidgetpaintable.c

index 23a359d204febd2c9dc9b86491d0f6b7c1e8a0fe..f1da13fed2cfbd1ce42a303764f9058dc4d11985 100644 (file)
@@ -91,28 +91,20 @@ gtk_widget_paintable_paintable_snapshot (GdkPaintable *paintable,
     return;
   else if (self->snapshot_count > 0)
     {
-      graphene_matrix_t transform;
       graphene_rect_t bounds;
 
       gtk_snapshot_push_clip (snapshot,
                               &GRAPHENE_RECT_INIT(0, 0, width, height));
+
       if (gtk_widget_compute_bounds (self->widget, self->widget, &bounds))
         {
-          graphene_matrix_init_from_2d (&transform,
-                                        width / bounds.size.width, 0.0,
-                                        0.0, height / bounds.size.height,
-                                        bounds.origin.x, bounds.origin.y);
-        }
-      else
-        {
-          graphene_matrix_init_identity (&transform);
+          gtk_snapshot_scale (snapshot, width / bounds.size.width, height / bounds.size.height);
+          gtk_snapshot_translate (snapshot, &bounds.origin);
         }
-      gtk_snapshot_push_transform (snapshot, &transform);
 
       gtk_widget_snapshot (self->widget, snapshot);
 
       gtk_snapshot_pop (snapshot);
-      gtk_snapshot_pop (snapshot);
     }
   else
     {